Skip to content

feat: add modern client lifecycle modes (SEP-2575)#995

Merged
DaleSeo merged 3 commits into
mainfrom
feat/sep-2575-stateless-lifecycle
Jul 16, 2026
Merged

feat: add modern client lifecycle modes (SEP-2575)#995
DaleSeo merged 3 commits into
mainfrom
feat/sep-2575-stateless-lifecycle

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jul 15, 2026

Copy link
Copy Markdown
Member

Motivation and Context

This builds on PR #973 for discovery and negotiation by letting clients start with server/discover instead of the legacy initialize handshake. Modern requests carry self-contained client metadata, while auto mode can fall back for legacy servers and the existing legacy lifecycle remains the default.

How Has This Been Tested?

The modern, auto-fallback, per-request metadata, and stateless Streamable HTTP paths are covered by integration tests.

Breaking Changes

No breaking changes. Existing clients continue to use the legacy lifecycle flow unless they explicitly select a modern lifecycle mode.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@DaleSeo DaleSeo self-assigned this Jul 15, 2026
@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-handler Handler implementation changes T-service Service layer changes T-transport Transport layer changes labels Jul 15, 2026
@DaleSeo
DaleSeo force-pushed the feat/sep-2575-stateless-lifecycle branch 2 times, most recently from c702157 to ce7fd9c Compare July 15, 2026 18:15
@github-actions github-actions Bot added T-documentation Documentation improvements T-dependencies Dependencies related changes T-CI Changes to CI/CD workflows and configuration T-config Configuration file changes labels Jul 15, 2026
@DaleSeo
DaleSeo marked this pull request as ready for review July 15, 2026 18:21
@DaleSeo
DaleSeo requested a review from a team as a code owner July 15, 2026 18:21
@DaleSeo
DaleSeo force-pushed the feat/sep-2575-stateless-lifecycle branch from ce7fd9c to fb26041 Compare July 15, 2026 20:20
@github-actions github-actions Bot added the T-model Model/data structure changes label Jul 15, 2026
@DaleSeo
DaleSeo force-pushed the feat/sep-2575-stateless-lifecycle branch from fb26041 to 5d6a6e0 Compare July 15, 2026 20:48
@DaleSeo DaleSeo changed the title feat: add modern client startup modes (SEP-2575) feat: add modern client lifecycle modes (SEP-2575) Jul 15, 2026
--scenario sep-2322-client-request-state \
-o conformance-client-results/mrtr
- name: Run draft SEP-2575 client scenario

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this combine/relate to https://github.com/modelcontextprotocol/rust-sdk/pull/991/changes#diff-bd4df60e4b8977afa547a4b2976c2aed79b2113b0fffad61810242961e7fc930R925 ?
cc @jamadeo

Ideally we'd just set the conformance tests to run all the scenarios relevant for the new version and see the list of failures get smaller as we check in support for things.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexhancock That PR added an interim plumbing so the scenarios could run at all without SDK changes. This PR actually replaces that harness, allowing all routes to go through the real public API.

Regarding running the whole draft suite, I thought about it, but the runner exits with a non-zero status on any failure. So, running all draft scenarios today would keep CI red until the remaining SEPs are completed. I'm fine with that, but we would need to be a bit careful not to miss any regressions.

Comment thread crates/rmcp/src/service/client.rs Outdated
Ok(())
}

async fn modern_startup<S, T>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts renaming the old code legacy_ instead of the new code modern_?

It strikes me it would be easier to deprecate and remove the legacy stuff if done this way vs having to ship all this and then rename it all when we don't want it to be called "modern" any more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Thanks for the suggestion. Will rename it.

alexhancock
alexhancock previously approved these changes Jul 16, 2026
@DaleSeo
DaleSeo force-pushed the feat/sep-2575-discovery-negotiation branch from b1bc9fd to 9b69a72 Compare July 16, 2026 17:39
@DaleSeo
DaleSeo force-pushed the feat/sep-2575-stateless-lifecycle branch from 4271da6 to a74e36f Compare July 16, 2026 17:44
Base automatically changed from feat/sep-2575-discovery-negotiation to main July 16, 2026 17:47
@DaleSeo
DaleSeo dismissed alexhancock’s stale review July 16, 2026 17:47

The base branch was changed.

@DaleSeo
DaleSeo force-pushed the feat/sep-2575-stateless-lifecycle branch from a74e36f to be98a64 Compare July 16, 2026 17:49
@alexhancock
alexhancock self-requested a review July 16, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-CI Changes to CI/CD workflows and configuration T-config Configuration file changes T-core Core library changes T-dependencies Dependencies related changes T-documentation Documentation improvements T-handler Handler implementation changes T-model Model/data structure changes T-service Service layer changes T-test Testing related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants